# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
#   Mayor.create(:name => 'Daley', :city => cities.first)

luan = User.create :username => 'luan',  
                   :password => '123456', 
                   :password_confirmation => '123456'
luan.profile = Profile.create(:name => 'Luan Pham', :email => 'minhluaniq@gmail.com')

reporter = User.create :username => 'reporter',  
                   :password => '123456', 
                   :password_confirmation => '123456'
reporter.profile = Profile.create(:name => 'Reporter', :email => 'reporter@hoangkhang.com.vn')

editor = User.create :username => 'editor',  
                   :password => '123456', 
                   :password_confirmation => '123456'
editor.profile = Profile.create(:name => 'Editor', :email => 'editor@hoangkhang.com.vn')

chairman = User.create :username => 'chairman',  
                   :password => '123456', 
                   :password_confirmation => '123456'
chairman.profile = Profile.create(:name => 'Chairman', :email => 'chairman@hoangkhang.com.vn')

editor.roles.create( :name => 'editor', :alias => 'EDITOR', :description => 'editor')
reporter.roles.create( :name => 'reporter', :alias => 'REPORTER', :description => 'reporter')
chairman.roles.create( :name => 'chairman', :alias => 'CHAIRMAN', :description => 'chairman')
luan.roles << Role.where("alias='EDITOR'").first
luan.roles << Role.where("alias='REPORTER'").first
luan.roles << Role.where("alias='CHAIRMAN'").first

#event = Event.create :title => 'su kien 1',
#                      :description => 'mo ta cho su kien 1 mo ta cho su kien 1 mo ta cho su kien 1 mo ta cho su kien 1 mo ta cho su kien 1 mo ta cho su kien 1 mo ta cho su kien 1 ',
#                      :user_id => User.first.id

#event.articles.create :title => 'bai viet 1 - su kien 1',
#                      :body => 'noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1',
#                      :user_id => User.first.id
#
#event.articles.create :title => 'bai viet 2 - su kien 1',
#                      :body => 'noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1',
#                      :user_id => User.first.id
#
#event.articles.create :title => 'bai viet 3 - su kien 1',
#                      :body => 'noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1',
#                      :user_id => User.first.id
#
#event.articles.create :title => 'bai viet 4 - su kien 1',
#                      :body => 'noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1',
#                      :user_id => User.first.id
#                      
#event.articles.create :title => 'bai viet 5 - su kien 1',
#                      :body => 'noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1 noi dung bai viet 1',
#                      :user_id => User.first.id
#                      
ArticleStatus.create :title => 'NEW', :description => 'new'
ArticleStatus.create :title => 'MODIFY', :description => 'modified'
ArticleStatus.create :title => 'CANCEL', :description => 'canceled'
ArticleStatus.create :title => 'CLOSE', :description => 'closed'
ArticleStatus.create :title => 'APPROVING', :description => 'approving'
ArticleStatus.create :title => 'APPROVED', :description => 'approved'
ArticleStatus.create :title => 'REEDITING', :description => 're-editing'
#
EventStatus.create :alias => 'NEW', :title => 'new'
EventStatus.create :alias => 'ASSIGNED', :title => 'assigned'
EventStatus.create :alias => 'CLOSED', :title => 'closed'
#
NewsStatus.create :title => 'NEW', :description => 'new'
NewsStatus.create :title => 'MODIFY', :description => 'modified'
NewsStatus.create :title => 'CANCEL', :description => 'canceled'
NewsStatus.create :title => 'CLOSE', :description => 'closed'
NewsStatus.create :title => 'APPROVING', :description => 'approving'
NewsStatus.create :title => 'APPROVED', :description => 'approved'
NewsStatus.create :title => 'REEDITING', :description => 're-editing'
#
#
Channel.create :title => 'Sport', :description => 'Sport'
Channel.create :title => 'Science', :description => 'Science'
Channel.create :title => 'Society and Culture', :description => 'Society and Culture'
#
Thumbnail.create :name => "tiny", :width => "50"
Thumbnail.create :name => "small", :width => "285", :height => "280"
Thumbnail.create :name => "medium", :width => "700", :height => "500"
#
#
hcm = City.create :name => 'Ho chi Minh'

hcm.areas.create :name => "Quan 1"
hcm.areas.create :name => "Quan 2"
hcm.areas.create :name => "Quan 3"
hcm.areas.create :name => "Quan 4"
hcm.areas.create :name => "Quan 5"
hcm.areas.create :name => "Quan 6"
hcm.areas.create :name => "Quan 7"
hcm.areas.create :name => "Quan 8"
hcm.areas.create :name => "Quan 9"
hcm.areas.create :name => "Quan 10"
hcm.areas.create :name => "Quan 11"
hcm.areas.create :name => "Quan 12"
hcm.areas.create :name => "Binh Thanh"
hcm.areas.create :name => "Go Vap"